package com.jye.cloud.user.controller;


import com.jye.cloud.domain.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/group")
public class GroupNacosController {

    @Value("${server-url.cloud-provider-user}")
    private String serverUrl;

    private String pre="/group";

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/test")
    public String test(){
       return serverUrl;
    }

    @GetMapping("/findGroupById")
    public JsonResult findUserById(int id){
        return restTemplate.getForObject(serverUrl+pre+"/findGroupById?id="+id,JsonResult.class);
    }


}
